<?php
// +----------------------------------------------------------------------
// | 幕小铺
// +----------------------------------------------------------------------
// | 版权所有 2016~2020 幕小铺科技（大连）有限公司
// +----------------------------------------------------------------------
// | 2020/03/14
// +----------------------------------------------------------------------
namespace app\user_center\behavior\user\add_user_black_before;

/**
 * 检测用户是否已经拉黑过
 * @package app\user_center\behavior\user\add_user_black_before
 * @author shiqiang
 */
class checkBlackByUid{
    /**
     * 执行行为 run方法是Behavior唯一的接口
     * @access public
     * @return void
     */
    public function run($params){
		$user_id 	= $params['user_id'];
		$black_uid 	= $params['black_uid'];
		
		$map = [];
		$map['uid'] = $user_id;
		$map['black_uid'] = $black_uid;
		$result = model('UcMemberBlackList', 'model\user') -> where($map) -> find();
		if(!empty($result)){
			return array_out(-1001,'您已经拉黑该用户了');
		}
    }
}
